package com.neu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.neu.base.Result;
import com.neu.entity.*;
import com.neu.mapper.CostMapper;
import com.neu.service.CostService;
import com.neu.service.ProjectRskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

@Service
public class CostServiceImpl extends ServiceImpl<CostMapper, Cost> implements CostService {

    @Autowired
    private PDRServiceImpl pdrService;

    @Autowired
    private RDFServiceImpl rdfService;

    @Autowired
    private SWFServiceImpl swfService;

    @Autowired
    private ProjectRskService projectRskService;

    @Autowired
    private ProjectServiceImpl projectService;

    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private CostMapper costMapper;

    @Override
    public ReportData getReportData(String id) {

        ReportData reportData = new ReportData();

        FpAnalysisValue fp = null;
        PDR pdr = pdrService.getById(id);
        RDF rdf = rdfService.getById(id);
        SWF swf = swfService.getById(id);
        ProjectRsk projectRsk = projectRskService.getById(id);
        Cost cost = costMapper.selectById(id);
        Project project = projectService.getById(id);

        Map map = new HashMap<>();
        reportData.setProjectName(project.getProjectName());
        reportData.setPdr(pdr);
        reportData.setRdf(rdf);
        reportData.setSwf(swf);
        reportData.setRsk(projectRsk);
        reportData.setCost(cost);
        reportData.setGscchoice(true);
        reportData.setGsc(null);
        reportData.setScale(null);


        return reportData;
    }
}
